package com.okami.sourcecode.spring;

import com.okami.sourcecode.spring.component.aware.OkamiAware;
import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.core.io.support.SpringFactoriesLoader;

import java.util.List;

/**
 * @author: TanJingyu
 * @create: 2020-12-17 11:45
 **/
class Test {
    public static void main(String[] args) {
//        ApplicationContext app = new AnnotationConfigApplicationContext("com.okami.sourcecode.spring.component");
//        OkamiAware okamiAware = (OkamiAware)app.getBean("okamiAware");
//        System.out.println(okamiAware.getBeanFactory());
//
//        Object student = app.getBean("student");
//        System.out.println(student);

//        List<String> initializers = SpringFactoriesLoader.loadFactoryNames(ApplicationContextInitializer.class, Test.class.getClassLoader());
//        System.out.println(initializers);
//        System.out.println(initializers.size());
//
//        ApplicationContext app = new AnnotationConfigServletWebServerApplicationContext("com.okami.sourcecode.spring.component");
    }
}
